#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <assert.h>

int
main(int argc, char **argv)
{
	static int a[100000];
	int n = -1;
	int max = 0;
	register int i;

	while (n) {
		scanf("%d", &n);
		a[n]++;

		if (n > max)
			max = n;
	}

	i = 1;
	while (i < max + 1) {
		if (a[i])
			printf("%6d %6d\n", i, a[i]);
		++i;
	}

	return 0;
}
